//package com.plian.system.controller.fr.internalauditmanagement;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.system.config.Resubmit;
//import com.plian.system.dto.fr.internalauditmanagement.IamWorkYearAuditProjecMasterDTO;
//import com.plian.system.entity.fr.internalauditmanagement.IamWorkYearAuditProjectMaster;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.fr.internalauditmanagement.IamWorkYearRecordMasterService;
//import com.plian.system.vo.fr.internalauditmanagement.IamWorkYearAuditProjectMasterVO;
//import com.plian.system.vo.fr.internalauditmanagement.IamWorkYearAuditProjectVO;
//import com.plian.system.wrapper.fr.internalauditmanagement.IamWorkYearAuditProjectMasterWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiResponse;
//import io.swagger.annotations.ApiResponses;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.List;
//
///**
// * 内审年度工作计划备案
// *
// * @author jiatp
// * @since 2023-02-21
// */
//@Slf4j
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/nsgl/iam_workyear_record")
//@Api(value = "内审年度工作计划备案", tags = "内审年度工作计划备案")
//public class IamYearRecordController extends BaseController {
//
//    private final IamWorkYearRecordMasterService recordMasterService;
//
//    private final IamWorkYearAuditProjectMasterWrapper auditProjectMasterWrapper;
//
//    /**
//     * 新增或修改
//     */
//    @ApiOperation(value = "新增或修改", notes = "新增或修改")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    public R submit(@Valid @RequestBody IamWorkYearAuditProjectMasterVO auditProjectMasterVO) {
//        return recordMasterService.submit(auditProjectMasterVO);
//    }
//
//
//    /**
//     * 查询详情
//     */
//    @ApiOperation(value = "查询详情", notes = "查询详情")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/detail")
//    public R<IamWorkYearAuditProjecMasterDTO> detail(@RequestBody IamWorkYearAuditProjectMasterVO auditProjectMasterVO) {
//        return R.data(recordMasterService.detail(auditProjectMasterVO));
//    }
//
//    /**
//     * 列表分页
//     */
//    @ApiOperation(value = "列表分页", notes = "列表分页")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/list")
//    public ListResult<IamWorkYearAuditProjectMasterVO> list(@RequestBody Query query) {
//        List<SearchEntity> entityList = query.getSearch();
//        if (query.getAscs() == null && query.getDescs() == null) {
//            query.setDescs("create_time");
//        }
//        QueryWrapper<IamWorkYearAuditProjectMaster> queryWrapper = SearchParamEntiy.getQueryWrapper(
//                Condition.getQueryWrapper(new IamWorkYearAuditProjectMaster()), entityList
//        );
//        TokenSearch<IamWorkYearAuditProjectMaster> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//        IPage<IamWorkYearAuditProjectMaster> pages = recordMasterService.page(Condition.getPage(query), queryWrapper);
//        ListResult<IamWorkYearAuditProjectMasterVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//        listResult.setList(auditProjectMasterWrapper.entityToVO(pages.getRecords()));
//        listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//        return listResult;
//    }
//
//
//    /**
//     * 删除
//     */
//    @ApiOperation(value = "删除", notes = "删除")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @Transactional(rollbackFor = Throwable.class)
//    @PostMapping("/remove")
//    public R remove(@RequestBody IamWorkYearAuditProjectVO reportRecordVO) {
//        List<Long> ids = reportRecordVO.getIds();
//        return recordMasterService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//}
